<%@include file = "/common/header.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    pageEncoding="UTF-8"%>
    <title>开始</title>
    <div class="container theme-showcase" role="main">
      <!-- Main jumbotron for a primary marketing message or call to action -->
      <div class="jumbotron">
        <div class="page-header">
        <h1>公告</h1>
      </div>
 <table class="table">
            <thead>
              <tr>
                <th>标题</th>
                <th>日期</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
         <c:forEach items="${list}" var="announce">
			<tr>
				<td>${announce.title}</td>
				<td><fmt:formatDate type="both" 
            dateStyle="short" timeStyle="short" 
            value="${announce.date}" /></td>
                <td>
                <c:if test="${student.stuID=='admin'}">
				<a href="AnnounceServlet?act=edit&annID=${announce.annID}"><c:out value="修改 "/></a>
				| |
				</c:if>
				<a href="AnnounceServlet?act=info&annID=${announce.annID}"><c:out value=" 查看"/></a>
				<c:if test="${student.stuID=='admin'}">
				| |
				<a href="AnnounceServlet?act=delete&annID=${announce.annID}" onclick="javascript:return checkDel()"><c:out value=" 删除"/></a>
				</c:if>
				</td>
			</tr>
		</c:forEach>
             
            </tbody>
          </table>
<nav>
  <ul class="pagination">
    <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
    <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">5</a></li>
    <li>
      <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
		
	<c:if test="${student.stuID=='admin'}">
		<div class="panel panel-danger">
            <div class="panel-heading">
              <h3 class="panel-title">添加公告</h3>
            </div>
            <div class="panel-body">
             <a href="addAnnounce.jsp"><button type="button" class="btn btn-xs btn-link" >入口</button></a>
            </div>
          </div>
     </c:if>
     <c:if test="${student.stuID!='admin'}">
		<div class="panel panel-danger">
            <div class="panel-heading">
              <h3 class="panel-title">报修报失入口</h3>
            </div>
            <div class="panel-body">
             <a href="addFix.jsp"><button type="button" class="btn btn-xs btn-link" >入口</button></a>
            </div>
          </div>
     </c:if>
   </div>
      </div>
    <!-- /container -->
<%@include file = "/common/footer.jsp" %>